import { createI18n } from 'vue-i18n'
import zhMessages from './zh.js'
import enMessages from './en.js'

// 读取本地存储中的语言设置，默认为中文
const savedLanguage = localStorage.getItem('local') || 'zh'

const i18n = createI18n({
    locale: savedLanguage,
    messages: {
        zh: zhMessages,
        en: enMessages
    }
})

export default i18n